<?php
/**
 * Created by XiaoYu.
 * User: XiaoYu
 * Date: 2021/8/2
 * Time: 11:12
 * Desc: ${Desc}
 */

namespace App\Http\Forms;


use App\Modules\Shop\Shop;
use Kris\LaravelFormBuilder\Form;

class RechargeForm extends Form
{
    public function buildForm()
    {
        $this
            ->add('user_id', 'select', [
                'attr'  => ['class' => "form-control select2", 'id' => "users-select"],
                'label' => "选择用户",
                'rules' => 'required|integer',
                'choices' => $this->getData('users')??[],
            ])
            ->add('cz_money', 'number', [
                'attr' => ['class' => "form-control form-money"],
                'label' => "充值金额",
                'rules' => 'required|numeric',
            ])
            ->add('zs_money', 'number', [
                'attr' => ['class' => "form-control form-money"],
                'label' => "赠送金额",
                'rules' => 'required|numeric',
            ])
            ->add('submit', 'submit', [
                'attr' => ['class' => "form-control btn btn-success"],
                'label' => '充值',
            ]);
    }
}
